package com.spring.springserver.service.impl;

import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

@Service
public class MyUserDetailsService implements UserDetailsService {
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return User.withUsername("user")
                .password("{bcrypt}$2a$10$7FodtAe0Pqa04jtD7YJcv.Khk8BpwicQCdwqr0K9pYTPLCCDygN3W")
                .roles("USER")
                .build();
    }
}
